<?php

class Form_Admin_Invoice extends Form_Custom_General {

    public function init() {
		
		$inv_subject = $this->createElement("text", "inv_subject")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter subject")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Subject"));
        $this->addElement($inv_subject);
		
		$inv_main_status = $this->createElement("select", "inv_main_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please select invoice status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($inv_main_status);
		
		$inv_date = $this->createElement("text", "inv_date")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter invoice date")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($inv_date);
		
		$inv_pay_before = $this->createElement("text", "inv_pay_before")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($inv_pay_before);
		
		$inv_currency = $this->createElement("text", "inv_currency")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setValue('US Dollar')
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Currency","readonly"=>"readonly"));
        $this->addElement($inv_currency);
		
		$inv_deal_id = $this->createElement("select", "inv_deal_id")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($inv_deal_id);
		
		$inv_quote_id = $this->createElement("select", "inv_quote_id")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($inv_quote_id);
		
		$inv_contractor_type = $this->createElement("select", "inv_contractor_type")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control company_client","placeholder"=>""));
        $this->addElement($inv_contractor_type);
		
		$inv_contractor_id = $this->createElement("select", "inv_contractor_id")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($inv_contractor_id);
		
		$inv_contact_person = $this->createElement("text", "inv_contact_person")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Contact Person"));
        $this->addElement($inv_contact_person);

		$inv_clnt_com_detail = $this->createElement("text", "inv_clnt_com_detail")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Client Company Detail"));
        $this->addElement($inv_clnt_com_detail);
		
		$inv_payment_method = $this->createElement("select", "inv_payment_method")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Payment Method"));
        $this->addElement($inv_payment_method);
		
		$inv_sales_representative_comment = $this->createElement("textarea", "inv_sales_representative_comment")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "r")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Sales Representative Comment"));
        $this->addElement($inv_sales_representative_comment);
		
		$inv_user_comments = $this->createElement("textarea", "inv_user_comments")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "r")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"User Comment"));
        $this->addElement($inv_user_comments);
		
		$inv_responsible = $this->createElement("text", "inv_responsible")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Responsible"));
        $this->addElement($inv_responsible);
		
		$inv_addedby = $this->createElement('text', 'inv_addedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control", "readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($inv_addedby);
        
        $inv_updatedby = $this->createElement('text', 'inv_updatedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control","readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($inv_updatedby);
		
		$inv_status = $this->createElement("select", "inv_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Status"));
		$this->addElement($inv_status);
		
		$submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }
}